package com.jml.jdk8.stream;


import java.util.stream.IntStream;

/**
 * @author:jml
 * @date: 2019/12/11 0011 22:13
 * @description：
 */
public class IntStreamTest {

     public static void main(String[] args) {
         //打印数组元素
         IntStream intStream = IntStream.of(new int[]{5, 6, 7});
         intStream.forEach(System.out::println);
         //
         IntStream.of(new int[]{5,6,7}).forEach(System.out::println);
        //打印[3,8}，前闭后开
         IntStream range = IntStream.range(3, 8);
         range.forEach(System.out::println);
         //
         IntStream.range(3, 8).forEach(System.out::println);
         //打印[3,8]，前闭后闭
         IntStream.rangeClosed(3, 8).forEach(System.out::println);
     }

}
